home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / atutr202.zip / ada_tutr.ada < prev    next >
Text File  |  1992-09-04  |  26KB  |  519 lines

  1. -- ADA_TUTR.ADA   Ver. 2.02   4-SEP-1992   Copyright 1988-1992 John J. Herro
  2. -- Software Innovations Technology
  3. -- 1083 Mandarin Drive NE, Palm Bay, FL  32905-4706   (407)951-0233
  4. --
  5. -- Before compiling this file, you must compile ONE of the following:
  6. --
  7. --    JANUS.ADA     Recommended when using a PC with Janus/Ada.
  8. --    MERIDIAN.ADA  Recommended when using a PC with a Meridian Ada compiler
  9. --                     and the Meridian DOS Environment Library.
  10. --    UNIX.ADA      Recommended for UNIX based systems, if you can also
  11. --                     compile ONECHAR.C or ALTCHAR.C with a C compiler and
  12. --                     link with Ada.
  13. --    VAX.ADA       Recommended when using VAX Ada.
  14. --    VANILLA.ADA   "Plain vanilla" version for all other systems.  Should work
  15. --                     with ANY standard Ada compiler.  On some systems,
  16. --                     VANILLA.ADA may require you to strike ENTER after each
  17. --                     response.  However, you don't have to strike ENTER with
  18. --                     recent versions of TeleGen Ada by Telesoft.
  19. --
  20. -- See the PRINT.ME file for more information on installing ADA-TUTR on other
  21. -- computers.
  22. --
  23. --
  24. -- Before Running ADA-TUTR on a PC:
  25. --
  26. -- ADA-TUTR uses ANSI escape sequences for highlighting, cursor positioning,
  27. -- reverse video, etc.  Before ADA-TUTR will work correctly on a PC, you must
  28. -- install the device driver ANSI.SYS, which came with your copy of DOS.  To
  29. -- install ANSI.SYS, do the following:
  30. --
  31. -- 1.  If there's a file CONFIG.SYS in the root directory of the disk from
  32. --     which you boot, type it and look for a line saying "DEVICE=ANSI.SYS"
  33. --     (without the quotes), in either upper or lower case.  If that line isn't
  34. --     present, add it to CONFIG.SYS anywhere in the file, using an ordinary
  35. --     text editor or word processor in the non-document mode.  If there's no
  36. --     CONFIG.SYS file, create one containing the single line "DEVICE=ANSI.SYS"
  37. --     (without the quotes).
  38. --
  39. -- 2.  If there's no file ANSI.SYS in your root directory, copy ANSI.SYS from
  40. --     your DOS distribution diskette to the root directory of the disk from
  41. --     which you boot.
  42. --
  43. -- 3.  Reboot the computer.  ADA-TUTR should then work correctly.
  44. --
  45.  
  46. -- Introduction:
  47. --
  48. -- ADA-TUTR provides interactive instruction in the Ada programming language,
  49. -- allowing you to learn at your own pace.  On a PC, access to an Ada compiler
  50. -- is helpful, but not required.  You can exit this program at any time by
  51. -- striking X, and later resume the session exactly where you left off.  If you
  52. -- have a color monitor, you can set the foreground, background, and border
  53. -- colors at any time by typing S.
  54. --
  55. -- ADA-TUTR presents a screenful of information at a time.  Screens are read
  56. -- in 64-byte blocks from the random access file ADA_TUTR.DAT, using DIRECT_IO.
  57. -- For most screens, ADA-TUTR waits for you to strike one character to
  58. -- determine which screen to show next.  Screens are numbered starting with
  59. -- 101; each screen has a three-digit number.  Screens 101 through 108 have
  60. -- special uses, as follows:
  61. --
  62. -- 101 - This screen is presented when you complete the Ada course.  It
  63. --       contains a congratulatory message.  After this screen is shown,
  64. --       control returns directly to the operating system; the program doesn't
  65. --       wait for you to strike a character.
  66. -- 102 - This screen is presented when you exit ADA-TUTR before completing the
  67. --       course.  After this screen is shown, control returns directly to the
  68. --       operating system; the program doesn't wait for you to strike a
  69. --       character.
  70. -- 103 - This screen is shown whenever you strike X.  It displays the number of
  71. --       the last screen shown and the approximate percentage through the
  72. --       course.  It then asks if you want to exit the program.  If you strike
  73. --       Y, screen 102 is shown and control returns to the operating system.
  74. --       If you type N, screen 108 is shown to provide a menu of further
  75. --       choices.  From screen 103, you can also strike M to see the main menu
  76. --       (screen 106).
  77. -- 104 - This is the opening screen.  It asks if you've used ADA-TUTR before.
  78. --       If you strike N, a welcome screen is presented and the course begins.
  79. --       If you strike Y, screen 107 is shown.
  80. -- 105 - This screen allows you to type the number of the next screen you want
  81. --       to see.  For this screen, instead of striking one character, you type
  82. --       a three-digit number and presses ENTER.  Any number from 104 through
  83. --       the largest screen number is accepted.
  84. -- 106 - This screen contains the main menu of topics covered in ADA-TUTR.
  85. --       When you select a main topic, an appropriate sub-menu is shown.
  86. -- 107 - This screen is shown when you say that you've used ADA-TUTR before.
  87. --       It says "Welcome back!" and provides a menu that lets you resume where
  88. --       you left off, go back to the last question or Outside Assignment, go
  89. --       to the main menu (screen 106), or go to any specified screen number
  90. --       (via screen 105).
  91. -- 108 - This screen is shown when you answer N to screen 103.  It provides a
  92. --       menu similar to screen 107, except that the first choice takes you
  93. --       back to the screen shown before you saw 103.  For example, if you
  94. --       strike X while viewing screen 300, you'll see screen 103.  If you then
  95. --       answer N, you'll see screen 108.  From 108 the first menu selection
  96. --       takes you back to 300.
  97. --
  98.  
  99. -- Format of the Data File:
  100. --
  101. -- ADA-TUTR.DAT is a random access file of 64-byte blocks.  The format of this
  102. -- file changed considerably with version 2.00 of ADA-TUTR.  It's now much more
  103. -- compact, and, although it's still a data file, it now contains only the 95
  104. -- printable ASCII characters.
  105. --
  106. -- The first block of ADA_TUTR.DAT is referred to as block 1, and the first 31
  107. -- blocks together are called the index.  Bytes 2 through 4 of block 1 contain,
  108. -- in ASCII, the number of the welcome screen that's shown when you say that
  109. -- you haven't used ADA-TUTR before.  Bytes 6 through 8 of block 1 contain the
  110. -- number of the highest screen in the course.  (Bytes 1 and 5 of block 1
  111. -- contain spaces.)
  112. --
  113. -- Bytes 9 of block 1 through the end of block 31 contain four bytes of
  114. -- information for each of the possible screens 101 through 594.  For example,
  115. -- information for screen 101 is stored in bytes 9 through 12 of block 1, the
  116. -- next four bytes are for screen 102, etc.  For screens that don't exist, all
  117. -- four bytes contain spaces.
  118. --
  119. -- The first of the four bytes is A if the corresponding screen introduces an
  120. -- Outside Assignment, Q if the screen asks a question, or a space otherwise.
  121. -- The next two bytes give the number of the block where data for the screen
  122. -- begins, in base 95!  A space represents 0, ! represents 1, " represents 2,
  123. -- # represents 3, $ represents 4, etc., through all the printable characters
  124. -- of the ASCII set.  A tilde (~) represents 94.
  125. --
  126. -- The last of the four bytes gives the position, 1 through 64, within the
  127. -- block where the data for this screen starts.  Again, ! represents 1,
  128. -- " represents 2, # represents 3, etc.
  129. --
  130. -- Data for the screens are stored starting in position 1 of block 32.  In the
  131. -- screen data, the following characters have special meaning:
  132. --
  133. --           %  turns on high intensity.
  134. --           @  displays the number of spaces indicated by the next
  135. --                 character (# represents 3, $ represents 4, etc.)
  136. --           \  turns on reverse video and leaves one space.
  137. --           ^  turns on high intensity and leaves one space.
  138. --           `  restores normal video.
  139. --           {  causes CR-LF.
  140. --           }  moves cursor to row 24, column 1, for a prompt.
  141. --           ~  restores normal video and leaves one space.
  142. --
  143. -- These characters have special meaning in screen 103 only:
  144. --
  145. --           #  shows approximate percentage through the course.
  146. --           $  shows the number of the screen seen before 103.
  147. --
  148. -- Immediately after }